import { axiosInstance } from '@/utils/axios'


/**
 * 发送消息
 * @param {string} msgContent 消息内容
 * @param {string} referenceMsgId 引用的消息ID
 * @param {string} targetId 目标用户ID
 * @param {string} type 消息类型
 * @returns
 */
export function sendMessageAPI(msgContent, referenceMsgId, targetId, type) {
    return axiosInstance.post(
        `/message/send_message?msgContent=${msgContent}&referenceMsgId=${referenceMsgId}&targetId=${targetId}&type=${type}`,
    )
}
/**
 * 获取用户联系人列表并配首条聊天记录
 * @returns
 */
export function getChatContactsMessageAPI() {
    return axiosInstance.get(`/message/get_chat_contacts_by_id`);
}
/**
 * 根据用户id获取聊天记录(与单个用户)
 * @param {string} index
 * @param {string} num
 * @param {string} targetId
 * @returns
 */
export function getMessageAPI(index, num, targetId) {
    return axiosInstance.get(`/message/get_message_by_id?index=${index}&num=${num}&targetId=${targetId}`);
}